# Maintainer: Alexey Pavlov <Alexpux@gmail.com>

pkgname=gzip
pkgver=1.10
pkgrel=1
pkgdesc="GNU compression utility"
arch=('i686' 'x86_64')
url="https://www.gnu.org/software/gzip/"
license=('GPL3')
groups=('compression')
depends=('bash' 'less')
install=gzip.install
source=(https://ftp.gnu.org/pub/gnu/gzip/gzip-$pkgver.tar.xz{,.sig}
        'gzip-1.6-msys2.patch')
sha256sums=('8425ccac99872d544d4310305f915f5ea81e04d0f437ef1a230dc9d1c819d7c0'
            'SKIP'
            '898fa6db2198252316cd80237b715a1faa107f74e40b3c70b32accaa81c5ef2d')
validpgpkeys=('155D3FC500C834486D1EEA677FD9FCCB000BEEEE')

prepare() {
  cd ${srcdir}/${pkgname}-${pkgver}

  patch -p1 -i ${srcdir}/gzip-1.6-msys2.patch
  autoreconf -fi
}

build() {
  cd ${srcdir}/${pkgname}-${pkgver}
  ./configure --build=${CHOST} --prefix=/usr
  make
}

check() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make check
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}
  make DESTDIR=${pkgdir} install
}
